#include<stdio.h>
#include<string.h>
#define maxLen 100 //0.5
int main()
{   	  		  
    char a[maxLen];
    char b[maxLen];
    printf("Please input the first str:");
    scanf("%s", a);
    getchar();
    printf("Please input the second str:");
    scanf("%s", b);
    int i = 0, j = 0;
    int ans = 0;
    while (i < strlen(a) - strlen(b) + 1)//1
    {   	  		  
        if (j == strlen(b))
        {   	  		  
            ans = 1;
            break;
        }
        if (a[i + j] == b[j])//1
            ++j;//1
        else
        {   	  		  
            j = 0;
            ++i;//1
        }
    }
    if (ans)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}